import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[5];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);
        int count = 1;
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] == arr[i-1]) {
                count++;
            } else {
                if (count > arr.length / 2) {
                    System.out.println(arr[i-1]);
                    return;
                }
                count = 1; // 重置计数
            }
        }

        // 检查最后一组元素是否是多数元素
        if (count > arr.length / 2) {
            System.out.println(arr[arr.length - 1]);
        }
    }
}